package hu.veilingsite.shared;

import java.io.Serializable;
import java.sql.Date;

@SuppressWarnings("serial")
public class Auction implements Serializable {
	private int id,author_id,category_id,startprice,numberOfBids;
	private String title,description;
	private Date endDate;
	public boolean visible;
	
	public Auction(){
		// Default constructor is required for serialation
	}
	
	public Auction(int id,int ai,int ci,String tt,String dp,int sp,Date ed,int vs) {
		this.id = id;
		author_id = ai;
		category_id = ci;
		title = tt;
		description = dp;
		startprice = sp;
		if (vs > 0) {
			visible = true;
		} else {
			visible = false;
		}
		endDate = ed;
	}
	
	public Auction(int id,int ai,int ci,String tt,String dp,int sp,Date ed,int vs,int nob) {
		this.id = id;
		author_id = ai;
		category_id = ci;
		title = tt;
		description = dp;
		startprice = sp;
		if (vs > 0) {
			visible = true;
		} else {
			visible = false;
		}
		endDate = ed;
		numberOfBids = nob;
	}
	
	public int getStartPrice(){
		return startprice;
	}
	
	public int getAuthor_id() {
		return author_id;
	}

	public void setAuthor_id(int authorId) {
		author_id = authorId;
	}

	public int getCategory_id() {
		return category_id;
	}

	public void setCategory_id(int categoryId) {
		category_id = categoryId;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getStartprice() {
		return startprice;
	}

	public void setStartprice(int startprice) {
		this.startprice = startprice;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isVisible() {
		return visible;
	}
	
	public int getVisible() {
		if (visible) {
			return 1;
		} else {
			return 0;
		}
	}
	
	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	public void setNumberOfBids(int nob) {
		numberOfBids = nob;
	}
	
	public int getNumberOfBids() {
		return numberOfBids;
	}
}